<!---
@自动生成 BY Kupe框架 www.kupebank.com
#date : 2017-11-02 09:32:35
#path : app/template/admin/user.indexcategory.html
--->
{if !$ajax}
{include file="header.inc.html"}
<style>
.sub{
	text-indent:30px;
}
.toggle,.editop{
	cursor:pointer;
}
</style>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
	  {include file="left.inc.html"}  
	  <div class="layui-body">
		<!-- 内容主体区域 -->
		<div style="padding: 15px;">


			<div class="layui-breadcrumb">
			   {include file="where.inc.html"}
			</div>
			{/if}
<div id="main_table_id">
		<table lay-filter="main_table_" class="layui-table">
		  <colgroup>
			<col width="60">
			<col width="80">
			<col width="80">
			<col width="60">
			<col width="60">
			<col width="250">
			<col>
		  </colgroup>
		<thead>
		<tr>
			<th>ID</th>
			<th>分组标识</th>
			<th>名称</th>

			<th>状态</th>
			<th>排序</th>
			<th>操作</th>
		</tr>
		</thead>
		{foreach $rs as $k => $v}
		<tr dataid="{$v.id}">
			
			<td>{$k+1}</td>
			<td class="fast"  datafield="tag">{$v.tag}</td>

			<td class="fast" datafield="name">{$v.name}</td>
			<td class="fast" datafield="status">{$v.status}</td>
			<td class="fast" datafield="porder">{$v.porder}</td>
			<td dataid="{$v.id}">
  <a class="layui-btn layui-btn-mini bind" lay-event="detail">{$ICON.add}绑定权限</a>
  <a class="layui-btn layui-btn-mini edit" lay-event="edit">{$ICON.edit}编辑分组</a>
  <a class="layui-btn layui-btn-danger layui-btn-mini del" lay-event="del">{$ICON.del}删除</a>  </td>
		</tr>


			
		{/foreach}

</table></div>


{if $ajax}

<script>
myinit();
</script>
{/if}



{if !$ajax}

			<button class="layui-btn layui-layout-rightxx" id="addcategory">{$ICON.add}添加分组</button>
			{**###################################################**}
			
		</div>	
	  </div><!-- /layui-body -->


<script>

var myinit = function(){
	$ = layui.$ ;

	$.each($('.edit'),function(){		
		$(this).click(function(){

			openPage('{_url m="editcategory"}&id='+$(this).parent().attr('dataid'),'编辑用户分组');
		});
	});
	$.each($('.bind'),function(){		
		$(this).click(function(){

			self.location.href='{_url m="bindmodule"}&id='+$(this).parent().attr('dataid');
		});
	});

	

	$.each($('.del'),function(){		
		$(this).click(function(){
			url = '{_url m="dodelcategory"}&id='+$(this).parent().attr('dataid')+"&t="+Math.random();
			myconfirm(url);
		});
	});
	
	fastEdit2('{_url m="fastcategory"}','fast');


};

layui.use(['table','layer'], function(){
  var table = layui.table, $ = layui.$ , layer = layui.layer;

  doFastEdit('{_url m="fast"}', 'main_table');
	/*绑定EDIT操作*/
	$('#addcategory').click(function(){		
		openPage('{_url m="addcategory"}','添加分组');			
	});
	myinit();

	
});

/*<input type="checkbox" name="status" value=1 checked lay-skin="switch">*/
</script>
{html}
<script type="text/html" id="statusTpl">
 {{# if (d.status == 1) { }}		
		开启
	{{#  } else { }}
		关闭
	 {{#  } }}
</script>
<script type="text/html" id="barDemo">
  <a class="layui-btn layui-btn-mini view" lay-event="detail" data="{{d.id}}">查看</a>
  <a class="layui-btn layui-btn-mini add_op" lay-event="detail" data="{{d.id}}">添加操作</a>
  <a class="layui-btn layui-btn-mini edit" lay-event="edit" data="{{d.id}}">编辑模块</a>
  <a class="layui-btn layui-btn-danger layui-btn-mini del" data="{{d.id}}" lay-event="del">删除</a>  

</script>

{/html}
{include file="footer.inc.html"}



{/if}









{**以下为历史模板,可用于其它页面*}
